#include "TaskFactory.h"

BaseTask *TaskFactory::getTask(int op, char *body, int len, int clientfd)
{
    BaseTask*task=nullptr;
    switch (op)
    {
    case LOGIN:
        task = new LoginTask(body, len, clientfd);
        break;
    case CHAT:
        task = new ChatTask(body, len, clientfd);
        break;
    case FRIEND:
        task = new FriendTask(body, len, clientfd);
        break;
    case  CHATMSG:
        task=new ChatrecodTask(body,len,clientfd);
        break;
    default:
        break;
    }
    return task;
}
